<html>
<head>
<title>iPlayer MCE</title>

  <link rel="STYLESHEET" type="text/css" href="Main.css"></link>
<script src="TunerFreeBBC.js" type="text/javascript"></script>
<script src="Spinner.js" type="text/javascript"></script>
<script src="BasicFunctions.js" type="text/javascript" ></script>
<script src="Scrolling.js" type="text/javascript"></script>
<script src="MoveFocus.js" type="text/javascript"></script>

<script language="JavaScript" id="clientEventHandlersJS">


  function gup( name )
  {
    name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
    var regexS = "[\\?&]"+name+"=([^&#]*)";
    var regex = new RegExp( regexS );
    var results = regex.exec( window.location.href );
    if( results == null )
      return "";
    else
      return unescape(results[1]);
  }

  function pageLoadFunctions()
  {
    playButton.MCFocusable="false";
    playButton.style.display="none";
    var playerId=gup("id");
    document.all.iPlayerFrame.src="http://www.bbc.co.uk/iplayer/episode/"+playerId;
    var title=gup("title");
    var episode=gup("episode");
    setArray();
    startFocus();
    setTimeout("play()",5000);
    CreateCustomViewport();


    window.external.MediaCenter.ScreensaverEnabledHint=false;
  }

  function CreateCustomViewport()
  {
	var MCE = window.external.MediaCenter();
	var CVPRectangle = window.external.MediaCenter.CustomViewPort.Rectangle;
	MCE.SharedViewPort.Visible = false;
	CVPRectangle.Left = 1;
	CVPRectangle.Top = 500;
	CVPRectangle.Width = 20;
	CVPRectangle.Height = 20;
	MCE.CustomViewPort.Rectangle = CVPRectangle;
  }

   function doSelect()
    {
    /* This function determines what your buttons do when they are selected
    (navigate, call a function, etc.). This function will get called whenever user
    clicks a focusable item, or selects it with "OK" button on remote. Make sure to
    include a case below for each focusable item on the page */
        switch(oCurFocus.id)
        {
            case "helpButton": // ID of button
            {
                  document.all.sound1.src ="Sounds/focus.wav";
              window.location.href="Help.htm";
              break;
            }
            case "playButton": // ID of button
            {
                  document.all.sound1.src ="Sounds/focus.wav";
              play();
              break;
            }
            case "pauseButton": // ID of button
            {
                  document.all.sound1.src ="Sounds/focus.wav";
              pause();
              break;
            }
            case "fsButton": // ID of button
            {
                  document.all.sound1.src ="Sounds/focus.wav";
              fullScreen();
              break;
            }
        }
    }

  </script>
</head>

<body id="body" MCFocusStart="pauseButton" onload="pageLoadFunctions()" onkeydown="onRemoteEvent(window.event.keyCode)">
<bgsound id="sound1" />

<table border="0" >
<tr style="height: 61px">
<td width="70%" valign="top">
<span class="Text1" id="titleSpan" MCFocusable="false">
<strong>Play Media</strong>
</span>
</td>
<td width="10%">
<span class="help_button" id="helpButton"  MCFocusable="true">
</span>
</td>
<td width="10%">
<span class="pause_button" id="pauseButton" MCFocusable="true" >
</span>
<span class="play_button" id="playButton" MCFocusable="true" >
</span>
</td>
<td width="10%">
<span class="fs_button" id="fsButton"  MCFocusable="true">
</span>
</td>
</tr>
<tr>
<td collspan="3" valign="top">
<span class="Text1" id="episodeDetails" MCFocusable="false">
<strong>Episode</strong>
</span>
</td>
</tr>
</table>
<span style="position: absolute; top: 0; left: 0; width: 100%;"> <center>
<iframe width="1000" height="1200" id="iPlayerFrame" name="iPlayerFrame" frameborder="0" />
</span>
</center>
</body>

<!--frameset rows="150,*" onload="pageLoadFunctions()" >
<frame frameborder=0 name="myJS">
<frame frameborder=0 name="iPlayer">
</frameset-->
</html>